package com.moive.news.tqnewsapplication.ui.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.moive.news.tqnewsapplication.R;
import com.moive.news.tqnewsapplication.base.BaseFragment;
import com.moive.news.tqnewsapplication.ui.activity.MainActivity;
import com.moive.news.tqnewsapplication.ui.activity.PutDynamicActivity;
import com.moive.news.tqnewsapplication.ui.activity.PutNewsActivity;
import com.moive.news.tqnewsapplication.utils.ToastUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2017/12/11.
 */

public class AddFragment extends BaseFragment {
    @BindView(R.id.fragment_ll01)
    LinearLayout fragmentLl01;
    @BindView(R.id.fragment_ll02)
    LinearLayout fragmentLl02;
    Unbinder unbinder;
    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_add, container, false);
        init(view);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    private void init(View view) {
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.fragment_ll01, R.id.fragment_ll02})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.fragment_ll01:
                ToastUtils.ShortToast("发表文章！");
                startActivity(new Intent(getActivity(), PutNewsActivity.class));
                break;
            case R.id.fragment_ll02:
                ToastUtils.ShortToast("发表心情！");
                startActivity(new Intent(getActivity(), PutDynamicActivity.class));
                break;

        }
    }


}
